package sundun.sharding.algorithm;

import org.apache.shardingsphere.sharding.api.sharding.hint.HintShardingAlgorithm;
import org.apache.shardingsphere.sharding.api.sharding.hint.HintShardingValue;

import java.util.Collection;
import java.util.Properties;

/**
 * 数据源分库算法
 * @author: zxl
 * @date: 2024-07-26 14:25
 **/
public class DataSourceHintShardingAlgorithm implements HintShardingAlgorithm<String> {

    @Override
    public Collection<String> doSharding(Collection<String> collection, HintShardingValue<String> hintShardingValue) {
        return hintShardingValue.getValues();
    }

    @Override
    public String getType() {
        return "数据源指定";
    }


    @Override
    public Properties getProps(){
        return null;
    }

    @Override
    public void setProps(Properties var1){

    }


    @Override
    public void init() {

    }
}
